/************************************************************
 * stack.h                                                  *
 * A stack that can contain any kind of data.               *
 * by Eric Brown.                                           *
 ************************************************************/
 
#ifndef STACK_H
#define STACK_H
 
#include <stdbool.h>
 
typedef struct Stack_Tag
{
    int size;       /*Size of each data.*/
    int quantity;   /*The number of the whole space.*/
    int top;        /*The top data's index.*/
    /* This is the array of the storage.*/
    unsigned char *storage;
}stack;
 
/*initialize: to initial a stack.*/
void initialize(stack *s, int size);    
 
/*cleanup: to clean a stack up.*/
void cleanUp(stack *s);
 
/*push: to push an element into a stack.*/
void push(stack *s, const void *element);
 
/*pop: to pop an element.*/
void * pop(stack *s);
 
bool isFull(stack *s);
 
int count(stack *s);
 
/*inflate: to expand the space to store the data.*/
void inflate(stack *s, int increase);
 
bool isEmpty(stack *s);
 
#endif